'use strict'

define(['jquery', 'bootstrap', 'select2', 'shiftform', 'validate', 'validate.en', 'datetimepicker'], function ($) {
  return {
    init: function () {
      this.initPage();
      this.initSearch();
    },
    
    initPage: function() {
    	$('input:radio[name="status"]').change( function() {
    	  var status = $(this).val();
    	  if(status) {
    		  window.location.href = window.__CTX__.root + "/abnormal-capacities?status=" + status;
    	  }
    	  
      })
    },
    
    initSearch: function() {
      $(document).on('shown.bs.modal', '#driver-search', function(e) {
        $(e.currentTarget).find('form[data-validate="true"]').bt_validate()  //bind validate
      });
    }
    
  }
})

